import request from '@/utils/request.js'

/**
 * 查询企业的部门列表
 * @returns
 */
export const getDepartments = () => {
  return request({
    url: '/company/department'
  })
}

/** *
 *  根据id根据部门 id:部门ID
 * **/
export function delDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

/** *
 *  新增部门
 * **/
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

/** *
 *  根据ID查询部门详情
 * **/
export function getDepartmentsById(id) {
  return request({
    url: '/company/department/' + id,
    method: 'GET'
  })
}

/** *
 *  根据ID修改部门详情
 * **/
export function editDepartmentsById(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'PUT',
    data
  })
}
